package com.dao.impl;

import java.sql.Connection;
import java.sql.DriverManager;

import com.dao.Dao;

public class DaoImpl implements Dao  {
	private Connection connection = null;

	@Override
	public Connection openconnection() throws Exception {
		Class.forName("com.mysql.jdbc.Driver");
		connection = DriverManager.getConnection(
				"jdbc:mysql://localhost:3306/studentdb", "root", "root");
		return connection;
	}

	@Override
	public void closeconnection() throws Exception {
		if (connection != null) {
			connection.close();
		}		
	}

	
	
}
